<template>
	<view class="main">
		<!-- 头部 -->
		<topCommonTitleBar :statePerchHeight="'var(--status-bar-height)'" arrow="black" dot-color="#333" :show-dot="true"
			@actionClick="showMore = true;" />

		<scroll-view scroll-y="true" :scroll-with-animation="true" :scroll-top="scrollTop"
			style="height: calc(100vh - 0rpx)" @scroll="getScrollTop">
			<view>
				<view class="content">
					<view id="plus">
						<!-- 详情内容 -->
						<view class="information" style="maring-top:100rpx">
							<view class="information_title">
								{{ dataList.title }}
							</view>
							<view class="information_cons">
								<view class="left ellipsis1">
									文章来源:{{ dataList.resource }}
								</view>
								<view class="right">
									时间：{{ dataList.push_date }}
								</view>
							</view>
							<view class="image">
								<image v-if="dataList.pic" :showLoading="true" :src="dataList.pic" style="width: 650rpx;height: 320rpx;"
									mode="aspectFill"></image>
							</view>
							<view class="information_content" :style="{ 'font-size': fontSize }">
								<u-parse v-if="showParse" :content="dataList.content" :lazyLoad="true" :tagStyle="{
									p: `font-size:${fontSize} !important`,
									span: `font-size: ${fontSize} !important`
								}" @linkTap="navigate">
								</u-parse>
							</view>
							<view class="information_share">
								<view class="image1">
									<image src="/static/img/wenTiKu/share_icon.png" mode="">
										<view class="py" @click="shareToTimeline">
											分享到朋友圈
										</view>
									</image>
								</view>
							</view>
							<view class="tag">
								好文章，需要你的分享鼓励
							</view>
						</view>
					</view>
				</view>

			</view>
		</scroll-view>


		<!-- 更多弹出层 -->
		<u-popup :show="showMore" :round="16" :closeOnClickOverlay="true" :customStyle="{ backgroundColor: 'transparent' }"
			class="showMore" @close="showMore = false">
			<view class="moreItem">
				<view class="item" v-for="(item, index) in menuList" :key="index" @click="menuClick(item)">
					<image :src="item.icon" class="icon"></image>
					<view class="titleMore">{{ item.name }}</view>
				</view>
			</view>
			<view class="close" @click="showMore = false">取消</view>
		</u-popup>
		<!-- 更多弹出层 end -->

		<!-- 字体切换弹出 -->
		<u-popup :show="showFontSize" :round="16" :closeOnClickOverlay="true"
			:customStyle="{ backgroundColor: 'transparent' }" class="showMore" @close="showFontSize = false">
			<view class="chang_font_size">
				<view class="text">
					<view style="font-size: 26rpx;" :style="{ color: fontSizeIndex == 0 ? '#1C87F3' : '' }"
						@click="changFontSize(0)">标准
					</view>
					<view style="font-size: 36rpx;" :style="{ color: fontSizeIndex == 1 ? '#1C87F3' : '' }"
						@click="changFontSize(1)">中
					</view>
					<view style="font-size: 46rpx;" :style="{ color: fontSizeIndex == 2 ? '#1C87F3' : '' }"
						@click="changFontSize(2)">大
					</view>
				</view>
				<view class="subsection">
					<view class="line-div" @click="changFontSize(0)">
						<view class="line"></view>
					</view>
					<view class="line-div" style="justify-content: center;" @click="changFontSize(1)">
						<view class="line"></view>
					</view>
					<view class="line-div" style="justify-content: flex-end;" @click="changFontSize(2)">
						<view class="line"></view>
					</view>
					<view class="line-x"></view>
					<view :class="['primary', fontSizeLeft]"></view>
				</view>
			</view>
			<view class="close" @click="showFontSize = false">取消</view>
		</u-popup>
		<!-- 字体切换弹出 end -->
	</view>
</template>

<script type="text/javascript" src="plus-confusion://../consult/consultDetails"></script>

<style lang="scss" scoped>
page {
	overflow: hidden;
}

.main {
	background-color: #F6F6F6;
	width: 100%;
}

.content {
	background-color: #FFFFFF;
	min-height: 1000rpx;

	.information {
		padding: 0px 51rpx;
		padding-top: 34rpx;

		.information_title {
			font-size: 40rpx;
			font-family: Source Han Sans CN-Bold, Source Han Sans CN;
			font-weight: bold;
			color: #333333;
			line-height: 56rpx;
		}

		.information_cons {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 24rpx;
			font-family: Source Han Sans CN-Normal, Source Han Sans CN;
			color: #666666;
			padding: 34rpx 0 52rpx 0;

			.left {
				width: 400rpx;
				line-height: 30rpx;
			}
		}
	}

	.information_content {
		width: 664rpx;
		font-size: 28rpx;
		font-family: Source Han Sans CN-Regular, Source Han Sans CN;
		font-weight: 400;
		color: #333333;
		line-height: 55rpx;
		margin-top: 40rpx;
	}

	.information_share {
		text-align: center;
		width: 330rpx;
		height: 84rpx;
		background: #FFFFFF;
		border-radius: 100px 100px 100px 100px;
		opacity: 1;
		border: 1px solid #D6D6D6;
		line-height: 84rpx;
		margin-left: 161rpx;
		margin-top: 60rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;

		.image1 {
			display: flex;
			justify-content: space-around;
			align-items: center;

			image {
				width: 36rpx;
				height: 36rpx;
				margin-left: 10rpx;
				border-radius: 0px 0px 0px 0px;
				opacity: 1;
				line-height: 36rpx;
			}

			.py {
				width: 156rpx;
				height: 40rpx;
				font-size: 26rpx;
				font-family: Source Han Sans CN-Normal, Source Han Sans CN;
				font-weight: 400;
				color: #666666;
				line-height: 40rpx;
			}
		}
	}

	.tag {
		font-size: 24rpx;
		font-family: Source Han Sans CN-Regular, Source Han Sans CN;
		color: #999999;
		margin-top: 24rpx;
		text-align: center;
		padding-bottom: 52rpx;
	}
}



.showMore {
	text-align: center;

	.moreItem {
		padding: 34rpx 26rpx;
		box-sizing: border-box;
		width: 700rpx;
		margin: 12rpx auto;
		border-radius: 16rpx;
		background-color: #FFFFFF;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		justify-content: flex-start;

		.item {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 162rpx;
		}

		.item:last-child {
			margin-top: 30rpx;
		}

		.item:nth-last-child(2) {
			margin-top: 30rpx;
		}

		.icon {
			width: 87rpx;
			height: 85rpx;
		}

		.titleMore {
			margin-top: 20rpx;
			font-size: 26rpx;
			color: #646566;
		}

	}

	.close {
		line-height: 94rpx;
		background-color: #FFFFFF;
		width: 700rpx;
		height: 94rpx;
		margin: 12rpx auto;
		margin-bottom: 34rpx;
		border-radius: 16rpx;
	}
}



.image {
	text-align: center;
	border-radius: 10px;
	overflow: hidden;
}

.chang_font_size {
	width: 700rpx;
	background: #FFFFFF;
	border-radius: 16rpx;
	margin: 12rpx auto;
	padding: 30rpx 60rpx;
	padding-bottom: 50rpx;

	.text {
		display: flex;
		align-items: center;
		justify-content: space-between;
		color: #333333;

	}

	.subsection {
		margin: 0 22rpx;
		margin-top: 40rpx;
		position: relative;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.line {
			width: 2rpx;
			height: 32rpx;
			background-color: #999999;
		}

		.line-x {
			height: 1rpx;
			width: 100%;
			background-color: #999999;
			position: absolute;
			left: 0;
		}

		.line-div {
			width: 60rpx;
			height: 32rpx;
			display: flex;
		}

		.primary {
			width: 38rpx;
			height: 38rpx;
			border: 8rpx solid #1C87F3;
			border-radius: 38rpx;
			background-color: #FFFFFF;
			position: absolute;
			transition: left 0.2s;
		}

		.primary1 {
			left: -17rpx;
		}

		.primary2 {
			left: calc(50% - 19rpx);
		}

		.primary3 {
			left: calc(100% - 19rpx);
		}
	}

}


.submit {
	font-size: 30rpx;
	font-family: Source Han Sans CN-Regular, Source Han Sans CN;
	font-weight: 400;
	color: #1C87F3;
	padding-left: 31rpx;
}



::v-deep .u-modal__content__text {
	text-align: center;
}

.class2 ::v-deep .u-modal__content__text {
	text-align: left;
}
</style>
